<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>    
    <div class="box1 box2 box3"></div>
    <script>
        var box = document.querySelector('.box1');
        console.log(box.classList);
        console.log(typeof box.classList);
        console.log(Array.isArray(box.classList));
        // var arr = new Array();
        // console.log(Array.isArray(arr));
        box.classList.add('box4');
        console.log(box.classList);
        box.classList.remove('box4');
        console.log(box.classList);
        box.classList.toggle('box3');
        console.log(box.classList);
        box.classList.toggle('box4');
        console.log(box.classList);
    </script>

</body>
</html>